﻿//----------------------------------------------------------------
// Copyright (c) 2011-2013 
// All rights reserved.
// Author: Ben DaoWei 
// Contact: bendaowei@gmail.com
// Web Link: http://xnaeditor.codeplex.com
// ----------------------------------------------------------------

namespace UnityEngine.Graphics
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using MdxLib.Model;
    using Microsoft.Xna.Framework.Graphics;

    public class MaterialRenderer : GraphicsRenderer
    {
        public CMaterial Material { get; set; }
        public MaterialLayerRenderer[] LayerRenderers { get; set; }

        public MaterialRenderer(CMaterial material, GraphicsDevice device)
            : base(device)
        {
            this.Material = material;
            LayerRenderers = new MaterialLayerRenderer[material.Layers.Count];
            for (int layerIndex = 0; layerIndex < material.Layers.Count; layerIndex++)
            {
                this.LayerRenderers[layerIndex] = new MaterialLayerRenderer(material.Layers[layerIndex], device);
            }
        }
    }
}
